#ifndef _CUDA_HOT_FIBER_TRACKING_H
#define _CUDA_HOT_FIBER_TRACKING_H

#include "../DWMRICore/Fiber.h"

#include <cutil_inline.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>


#define MAX_GPU_COUNT 32					/* CUDA */
#define THREADS_PER_RUN	1024				/* CUDA */

struct CUDA_Seed {
	float3 pos;
	float3 dir;
	int id;
};

struct CUDA_Fiber {
	float3 f[MAX_POINTS];
	float3 b[MAX_POINTS];
	int fc;
	int bc;
	CUDA_Seed seed;
};

struct GPUPlan {
	// device ID
	int deviceID;

	// host memory
	CUDA_Fiber *h_pFibers;
	CUDA_Seed *h_pSeeds;

	// device memory
	cudaArray *d_pMASK;
	cudaArray *d_pDTI[2];
	cudaArray *d_pHOT[7];

	float3 *d_pSamplePoints;
	float *d_pSampleWeights;
	CUDA_Fiber *d_pFibers;
	CUDA_Seed *d_pSeeds;

	//Stream for asynchronous command execution
	cudaStream_t stream;
};

#endif